﻿<%@ Page Language="C#" MasterPageFile="~/Admin/Admin.master" AutoEventWireup="true" CodeFile="PhanCongViec.aspx.cs" Inherits="Admin_PhanCongViec" Title="Phân công việc" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<div class="wrap">
        <h2> Phân công việc
            <asp:HyperLink ID="HyperLink2" runat="server" CssClass="node"
            NavigateUrl="~/Admin/QuanLyGiangVien.aspx" BackColor="#F1F1F1" >Hủy bỏ</asp:HyperLink>
        </h2>
    </div>
    <div style="clear: both;">&nbsp;</div>

    <div class="wrap" style="border: solid 1px #CCCCCC;">
        <table >
            <tr style="border: solid 1px #CCCCCC;">
                <td style="width: 120px">Mã số giảng viên</td>
                <td style="width: 280px">
                    <asp:TextBox ID="txtMSGV" runat="server" ></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                        ControlToValidate="txtMSGV" ErrorMessage="Chưa nhập mã giảng viên">*</asp:RequiredFieldValidator>
                    <asp:Button ID="BtTimGV" runat="server" Text="Tìm giảng viên" CssClass="button_cua_tao" 
                        onclick="BtTimGV_Click" />
                </td>
            </tr>
            <tr>
                <td style="width: 100px">Họ tên</td>
                <td >
                    <asp:TextBox ID="txtHoTenGV" runat="server" Enabled="False"  ></asp:TextBox></td>
            </tr>
            <tr>
                <td style="width: 100px">Môn học</td>
                <td style="width: 105px">
                    <asp:DropDownList ID="ddlMonHoc" runat="server" 
                        onselectedindexchanged="ddlMonHoc_SelectedIndexChanged"
                        AutoPostBack="True">
                    </asp:DropDownList>
                </td>
            </tr>
            <tr>
                <td style="width: 100px">Lớp tín chỉ</td>
                <td style="width: 105px">
                    <asp:DropDownList ID="dllLopTC" runat="server">
                    </asp:DropDownList>
                </td>
            </tr>
        </table>
        
	</div>
	    <div class="wrap" style="padding:4px; margin:3px;">
		    <asp:ValidationSummary ID="ValidationSummary1" runat="server" />
		    <asp:Button ID="btnSavePerson" CssClass="button_cua_tao" runat="server" 
                Text="Lưu thông tin"  onclick="btnSavePerson_Click" />
	    </div>

<div class="wrap" align="center" style="width:100%; border: solid 1px #CCCCCC;padding-top:0px; height:300px;  overflow:auto;">
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
    <ContentTemplate>

     <asp:GridView ID="GridView_PhanCong" runat="server" AutoGenerateColumns="False" 
         AllowPaging="True"  Width="100%" 
         onrowdatabound="GridView1_RowDataBound"  
            DataKeyNames="MsGiangVien,MsLopTC" 
            onpageindexchanging="GridView_GiangVien_PageIndexChanging" 
            onrowcommand="GridView_GiangVien_RowCommand" GridLines="None" >
         <Columns>
            <asp:TemplateField HeaderText="" >
                <ItemTemplate>
                    <input name="MyRadioButton" type="radio"  style="width:35px;"
                                value='<%# Eval("MsGiangVien") %>' />
                </ItemTemplate>
            </asp:TemplateField>

             <asp:BoundField DataField="MsGiangVien" HeaderText="Mã số giảng viên" 
                 ReadOnly="True" SortExpression="MsGiangVien" />
             <asp:TemplateField HeaderText="Tên giảng viên">
                <ItemTemplate>
                    <%#Eval("tbl_GIANGVIEN.TenGiangVien")%>
                </ItemTemplate>
            </asp:TemplateField>

             <asp:BoundField DataField="MsLopTC" HeaderText="Mã lớp tín chỉ" 
                 SortExpression="MsLopTC" ReadOnly="True" />
            <asp:TemplateField HeaderText="Tên môn học">
                <ItemTemplate>
                    <%#Eval("tbl_LOPTC.tbl_MONHOC.TenMonHoc")%>
                </ItemTemplate>
            </asp:TemplateField>
             <asp:BoundField DataField="GhiChu" HeaderText="GhiChu" 
                 SortExpression="GhiChu">
             </asp:BoundField>
                <asp:TemplateField ShowHeader="False">
                    <ItemTemplate>
                        <asp:ImageButton ID="ImageButton2" runat="server" CausesValidation="true" 
                            CommandName="MyDelete" ImageUrl="~/Images/cross.png" CommandArgument='<%#Eval("MsGiangVien") + ","+Eval("MsLopTC") %>'
                            Text="Delete" style="padding-left:10px; padding-right:10px;"/>
                        <ajaxToolkit:ModalPopupExtender BackgroundCssClass="modalBackground" ID="lnkDelete_ModalPopupExtender"
                            runat="server" TargetControlID="ImageButton2" PopupControlID="DivDeleteConfirmation"
                            OkControlID="ButtonDeleleOkay" CancelControlID="ButtonDeleteCancel">
                        </ajaxToolkit:ModalPopupExtender>
                        
                        <ajaxToolkit:ConfirmButtonExtender ID="lnkDelete_ConfirmButtonExtender" runat="server" Enabled="True"
                            TargetControlID="ImageButton2" DisplayModalPopupID="lnkDelete_ModalPopupExtender">
                        </ajaxToolkit:ConfirmButtonExtender> 
                    </ItemTemplate>

                </asp:TemplateField>


         </Columns>
            <RowStyle BackColor="#EFF3FB" />
            <SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="#663399" />
            <PagerStyle BackColor="#FFFFCC" ForeColor="#330099" HorizontalAlign="Center" />
            <HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="#FFFFCC" />
            <AlternatingRowStyle BackColor="White" />
     </asp:GridView>
     
        <asp:LinqDataSource ID="LinqDataSource1" runat="server" 
            ContextTypeName="DataClassesDataContext" TableName="tbl_PHANCONGVIECs">
        </asp:LinqDataSource>
         </ContentTemplate>
    </asp:UpdatePanel>
</div>

<%-- Bảng thông báo xóa dữ liệu--%>
        <asp:Panel runat="server" ID="DivDeleteConfirmation" Style="display: none;" class="modalBox">
        <div>
            <div class="popup_Titlebar" id="PopupHeader">
                <div class="TitlebarLeft">
                    Xóa dữ liệu</div>
                <div class="TitlebarRight" onclick="$get('ButtonDeleteCancel').click();">
                </div>
            </div>
            <div class="popup_Body">
                <p>Bạn có chắc chắn muốn xóa ? </p>
            </div>
            <div class="popup_Buttons">
                <input id="ButtonDeleleOkay" value="Okay" type="button" />
                <input id="ButtonDeleteCancel" value="Cancel" type="button" />
            </div>
        </div>
        </asp:Panel>

</asp:Content>

